import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { NgxPaginationModule } from 'ngx-pagination';
import { RouterModule } from '@angular/router';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { MatToolbarModule, MatButtonModule, MatTableModule, MatCheckboxModule, MatDialogModule,
        MatFormFieldModule, MatInputModule, MatPaginatorModule, MatPaginatorIntl,
  MatMenuModule, MatSelectModule, MatDatepickerModule, MAT_DATE_LOCALE, MAT_DATE_FORMATS,
} from '@angular/material';
import { MatMomentDateModule } from '@angular/material-moment-adapter';
import { PaginationComponent } from '../components/pagination/pagination';
import { MatPaginatorIntlService } from '../service/MatPaginatorIntlService';
import { myFormats } from '../environments/environment';
import { AppSelectComponent } from '../components/appSelect/appSelect';
import { AppOptionComponent } from '../components/appOption/appOption';
@NgModule({
    imports: [
      CommonModule, FormsModule,
      NgxPaginationModule, RouterModule,
      BrowserAnimationsModule, MatToolbarModule,
      MatButtonModule, MatTableModule,
      MatCheckboxModule, MatDialogModule,
      MatFormFieldModule, MatInputModule,
      MatPaginatorModule, MatMenuModule,
      MatSelectModule, MatDatepickerModule,
      MatMomentDateModule,
        ],
    declarations: [
      PaginationComponent,
      AppSelectComponent,
      AppOptionComponent,
    ],
    providers: [
      { provide: MatPaginatorIntl, useClass: MatPaginatorIntlService},
      {provide: MAT_DATE_LOCALE, useValue: 'zh-cn'},
      {provide: MAT_DATE_FORMATS, useValue: myFormats},
    ],
    exports: [
      CommonModule,
      FormsModule,
      NgxPaginationModule,
      RouterModule,
      BrowserAnimationsModule,
      MatToolbarModule,
      MatButtonModule,
      MatTableModule,
      MatCheckboxModule,
      MatDialogModule,
      MatFormFieldModule,
      MatInputModule,
      MatPaginatorModule,
      MatMenuModule,
      MatSelectModule,
      MatDatepickerModule,
      MatMomentDateModule,
      PaginationComponent,
      AppSelectComponent,
      AppOptionComponent,
    ]
})
export class ShareModule {}
